<template>
	<view class="tit-box" @mousedown="mousedown" @dblclick="onDbClickHandler">
		<minMaxClose ref="minMaxClose"></minMaxClose>
		<view class="tit" v-for="(item,index) in pTitList" @click="pTitClick(item)">
			<text class="txt" :class="{'txt-s':curId == item.id}">{{item.title}}</text>
		</view>
	</view>
</template>

<script>
	import lang from "../../../js/conf/Lang.js";
	import minMaxClose from "../../min-max-close.vue";
	import windBtnContrl from "../../../js/WinBtnContrl.js";
	export default
	{
		components:{minMaxClose},
		data()
		{
			return{
				pTitList :
				[
					{
						title:lang.subjectTxt,
						id:1,
					},
					{
						title:lang.aboutSTxt,
						id:2,
					}
				],
				curId:1,
			}
		},
		methods:{
			onDbClickHandler()
			{
				this.$refs.minMaxClose.changeMax();
			},
			/***移动窗口***/
			mousedown()
			{
				windBtnContrl.mousedown();
			},
			pTitClick(item)
			{
				if(this.curId == item.id)return;
				this.curId = item.id;
				this.$emit("setCurPage",item);
			},
			setCurId(id)
			{
				this.curId = id;
			}
		},
	}
</script>

<style lang="scss">
	.tit-box
	{
		display: flex;
		justify-content: space-around;
		font-size: 18px;
		padding-left: 10px;
		padding-top: 10px;
		padding-bottom: 10px;
		width: calc(100% - 10px);
		border-bottom: 1px solid #EDEDED;
		position: relative;
		.tit
		{
			cursor: pointer;
			.txt-s
			{
				color: #3388FF;
				border-bottom: 2px solid #3388FF;
			}
		}
	}
</style>
